<?php
	header('Content-Type:application/json');
	header("content-type:text/html;charset=utf-8");
	include('connect.php');
	$changeState = $_POST['value'];
	// $changeState = "正常";
	$sql="update totalinfo set nowState = '{$changeState}'  where 1 order by time desc limit 1";
	// echo $sql;
	$try = $db->query($sql);
	if($try){
		$json['code']=1;
		$json['msg']='状态修改成功';
		 echo (json_encode($json)) ;
	}else{
		$json['code']=0;
		$json['msg']='状态修改失败';
		 echo (json_encode($json)) ;
	}
?>